Skip to content

feat: add notification system (for blocks) - #1475

Open
rudimatz wants to merge 9 commits into
ietf-tools:mainfrom
rudimatz:feat/add-notification-system
Open

feat: add notification system (for blocks)#1475
rudimatz wants to merge 9 commits into
ietf-tools:mainfrom
rudimatz:feat/add-notification-system

Conversation

@rudimatz

@rudimatz rudimatz commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

fix #1426

implement a simple notification/broadcast system:

  • new Notifications are currently created when a draft becomes unblocked
  • System allows for broadcasts (send to all) or individual notifications per user
  • a bell on top right of screens indicates if there are new notifications
  • a notification page lists all past notifications

System is versatile and can be user for more use-cases later

@rudimatz
rudimatz marked this pull request as draft August 24, 2026 19:21
@rudimatz
rudimatz force-pushed the feat/add-notification-system branch from 7e798a5 to 89c2813 Compare August 31, 2026 15:52
@rudimatz
rudimatz marked this pull request as ready for review August 31, 2026 15:54
@rudimatz

Copy link
Copy Markdown
Contributor Author

displays a bell that will link to a new notification page
image

@jennifer-richards jennifer-richards left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few nits / comments inline.

Comment thread rpc/api.py
if person is None:
return Response({"count": 0})
seen_at = self._seen_at(person)
unread = Q() if seen_at is None else Q(created__gt=seen_at)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a style comment (not even a nit really): IMO this would be easier to read if it were written out as something like unread = self.get_queryset() if seen_at is None else self.get_queryset().filter(created_at...) instead of by passing Q() objects around. (Really, I'd probably write it out as a multi-line if statement)

I'm not really asking for a change, just noticed this and have been bitten by operations on Q objects being counterintuitive at times. For readability / maintainability, sometimes it's better to be a little wordier or use additional lines of code.

Comment thread rpc/models.py
)
# Denormalized event detail (draft name, blocking reason names) so a
# notification renders without re-deriving state that may since have changed.
data = models.JSONField(default=dict, blank=True)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might consider separately modeling draft_name (as a char field) and reasons (as an arrayfield or a JSONField that's a list) to reduce the amount of denormalized schema. The serializer code is depending on the structure of this denormalized data which is a hint that a JSONField is creating a hidden maintenance burden.

@@ -0,0 +1,53 @@
import { ref, onBeforeMount, onUnmounted, readonly } from 'vue'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing copyright stmt


const markAllRead = async () => {
if (!api) return
await api.notificationsMarkRead()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unhandled exception opportunity - is there a sensible thing to do if this API call fails?

Comment thread rpc/api.py
def get_queryset(self):
user = self.request.user
if not user.is_authenticated:
return Notification.objects.none()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this API is exposed for non-authenticated users. Might consider raising an exception or emitting a log if a non-authenticated user gets here as an early warning that something is not working as expected. (OTOH that might be better covered by a test that does a more systematic confirmation that our auth system is operating as intended and doing it at an API-by-API level is not desirable)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Notify when a document moves to In Progress because their norm refs are in the queue

2 participants